package com.bawei.hilt_test;

import androidx.appcompat.app.AppCompatActivity;
import dagger.hilt.android.AndroidEntryPoint;
import retrofit2.Retrofit;

import android.os.Bundle;
import android.util.Log;

import javax.inject.Inject;

//HiltActivity添加@AndroidEntryPoint注解+实例变量添加@Inject注解并且不能私有
@AndroidEntryPoint
public class MainActivity extends AppCompatActivity {
    @Inject
    User user;
    @Inject
    @RetrofitStandard
    Retrofit mRetrofit;
    @Inject
    @RetrofitToken
    Retrofit mRetrofit2;
    @Inject
    @RetrofitToken
    Retrofit mRetrofit3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        user.show();
        Log.d("ytx", "onCreate: "+mRetrofit);
        Log.d("ytx", "onCreate: "+mRetrofit2);
        Log.d("ytx", "onCreate: "+mRetrofit3);
    }
}